// 静态路由
import Main from '@/components/main'
import parentView from '@/components/parent-view'
import Login from '@/view/login/login'
import Home from '@/view/single-page/home'
import Error401 from '@/view/error-page/401.vue'
import Error404 from '@/view/error-page/404.vue'
import Error500 from '@/view/error-page/500.vue'

// 动态权限路由
import TopicList from '@/view/steady/topicList/index'
import Topic from '@/view/steady/topic/topic'
import Lesson from '@/view/steady/lesson/lesson'
import Module from '@/view/steady/module/module'
import Game from '@/view/steady/game/game'
import Course from '@/view/steady/course/course'
import Role from '@/view/system/role/role'
import Resource from '@/view/system/resource/resource'
import User from '@/view/system/user/user'
import Log from '@/view/system/log/log'

// 路由表
export const routerMap = {
  Main,
  parentView,
  Login,
  Home,
  Error401,
  Error404,
  Error500,
  TopicList,
  Topic,
  Lesson,
  Module,
  Game,
  Course,
  Role,
  Resource,
  User,
  Log
}

// 静态路由组合，不需要从接口获取的

export const staticRouters = [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: Login
  },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          hideInMenu: true,
          title: '首页',
          notCache: true,
          icon: 'md-home'
        },
        component: Home
      }
    ]
  },
  // {
  //   path: '/401',
  //   name: 'error_401',
  //   meta: {
  //     hideInMenu: true
  //   },
  //   component: Error401
  // },
  // {
  //   path: '/500',
  //   name: 'error_500',
  //   meta: {
  //     hideInMenu: true
  //   },
  //   component: Error404
  // },
  // {
  //   path: '*',
  //   name: 'error_404',
  //   meta: {
  //     hideInMenu: true
  //   },
  //   component: Error404
  // },
  {
    path: '*',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: Error401
  }
]
